package com.game.majiang.logic;

import java.util.ArrayList;
import java.util.List;

import com.game.majiang.algorithm.PaperCard;
import com.game.server.message.proto.out.PaperCardStructrue;
import com.game.server.message.proto.out.PlayerInfo;
import com.game.server.system.AbstractClient;
import com.game.server.system.AbstractPlayer;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public abstract class LogicPlayer extends AbstractPlayer{
	
	protected boolean isBanker = false;
	/**
	 * 是否准备
	 */

	protected boolean ready = false;
	protected int seatNo = -1;
	protected long liuZuoEndTime = 0;//留座时间结束时间
	protected long setBoboTime = System.currentTimeMillis();//钵钵不足 设置钵钵倒计时 时间倒站起
	protected boolean nextStandUpBool = false;//下局站起
	protected int nextLiuzuoTimeType = -1;//下局留座时间类型  有就留座
	protected int autoOperateCount = 0;//自动操作次数 两次站起
	protected int delayedCount = 0;//没小局延时操作次数
	protected int win = 0;//单局赢分 自己吃到的
	protected int usebobo = 0;//当局能用的总钵钵
	protected boolean bankerKickPeopleBool = false;
	public LogicPlayer(AbstractClient client) {
		super(client);
		
	}
	
	public abstract PlayerInfo toPlayerInfo(int uid);
	public PaperCardStructrue[] paperCardToCardStructrue(List<PaperCard> pcs) {
		ArrayList<PaperCardStructrue> list = new ArrayList<>();
		for (PaperCard paperCard : pcs) {
			PaperCardStructrue cs = new PaperCardStructrue();
			cs.setId(paperCard.getId());
			cs.setNum(paperCard.getNum());
			cs.setType(paperCard.getType());
			list.add(cs);
		}
		return list.toArray(new PaperCardStructrue[list.size()]);
	}
}
